﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Compiler
{
    /// <summary>
    /// 词法记号
    /// </summary>
    public class Token
    {
        public Token() { }
        public Token(string lexeme, string type, string value)
        {
            Lexeme = lexeme;
            Type = type;
            Value = value;
        }
        /// <summary>
        /// 词法单元
        /// </summary>
        public string Lexeme { get; set; }
        /// <summary>
        /// 记号名
        /// </summary>
        public string Type { get; set; }
        /// <summary>
        /// 值
        /// </summary>
        public string Value { get; set; }
        /// <summary>
        /// 分析出的词法记号
        /// </summary>
        public static List<Token> Tokens { get; set; } = new List<Token>();
        public static Queue<Token> Queue { get; set; } = new Queue<Token>();
        /// <summary>
        /// 使用时 初始化
        /// </summary>
        public static void Init()
        {
            Tokens.Clear();
            Queue.Clear();
        }
    }
}
